package com.zc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zc.mappper.PaymentMapper;
import com.zc.model.Payment;
import com.zc.service.PaymentService;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @description:
 * @author: cong
 * @create: 2024/9/29
 */
@Service
public class PayServiceImpl extends ServiceImpl<PaymentMapper, Payment> implements PaymentService {

    @Override
    public String paymentInfoOk() {
        return "线程池" + Thread.currentThread().getName() + "成功访问";
    }

    @Override
    public String paymentTimeOut() {
        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "线程池" + Thread.currentThread().getName() + "超时5s成功访问";
    }
}
